Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register stub setgeopoint implementation that does nothing #79

Merged
merged 2 commits into from
Sep 9, 2019

Conversation

lognaturel
Copy link
Member

The default stub from JavaRosa writes a string out which fails if the target node type is e.g. geopoint.

Needed to address XLSForm/pyxform#351

What has been done to verify that this works as intended?

I tried metadata.xml.txt before the fix, confirmed it fails because of a casting issue, applied the fix, confirmed that it works.

Why is this the best possible solution? Were any other approaches considered?

I considered changing the stub implementation in JavaRosa to write something in geopoint format, probably 0 0 0 0, but I think it's helpful for JR tests to have the "no implementation" text and I think it makes it more likely clients would notice they've made a mistake if they don't register their own action handler.

For Validate, having the action do nothing is ideal. We can't do that at the JR level because it doesn't allow us to test that the basic action setup (abstract SetGeopointAction class) works.

Are there any risks to merging this code? If so, what are they?

I can't think of any. This only affects forms that have setgeopoint actions. It adds support for those forms and I think the only risk is that it doesn't work in some contexts.

The default stub from JavaRosa writes a string out which fails if the target node type is e.g. geopoint.
Copy link
Member

@yanokwa yanokwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good comment, but it took digging into JavaRosa to understand. A little bit more prose, would have helped.

  • s/name/ELEMENT_NAME
  • s/reference/TargetReference
  • s/handle/handle()

@yanokwa
Copy link
Member

yanokwa commented Sep 9, 2019

Can you confirm you tried this fix with pyxform running Validate?

@lognaturel
Copy link
Member Author

I've tried to add more context to the comment and I hope that helps.

Can you confirm you tried this fix with pyxform running Validate?

I tried it just with Validate but did not put the patched Validate in pyxform. I don't think that would be any different than validating standalone.

@yanokwa
Copy link
Member

yanokwa commented Sep 9, 2019

Confirmed that running test_set_geopoint in pyxform with run_odk_validate=True with this new jar works.

@yanokwa yanokwa merged commit 4c56770 into getodk:master Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants